<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: magic_thunder.php 6757 2010-03-25 09:01:29Z cnteacher $
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

if(submitcheck("usesubmit")) {

	magic_use($mid, array(), true);

	$uid = $_G['uid'];


	$_G['uid'] = 0;

	loaducenter();
	$avatar_exists = uc_check_avatar($_G['uid'], 'middle');
	$avatar = $avatar_exists ? avatar($uid, 'middle',true) : UC_API.'/images/noavatar_middle.gif';

	feed_add(
		'thunder', 'magicuse_thunder_announce_title',
			array(
				'uid' => $uid,
				'username' => "<a href=\"home.php?mod=space&uid=$uid\">$_G[username]</a>"),
			'magicuse_thunder_announce_body',
			array(
				'uid' => $uid,
				'magic_thunder' =>1), '', array($avatar), array("home.php?mod=space&uid=$uid")
	);
	showmessage('magicuse_success', dreferer());
}

?>